define(function(require, exports, module) {
    require("echarts");
    var option = {
    	    title : {
    	        text: '本月预定房间汇总'
    	    },
    	    dataZoom:{
    	    	show:true
    	    },
    	    xAxis : [{
    	            type : 'category',
    	        }],
    	    yAxis : [{
    	            type : 'value'
    	        }],
    	    series : [{
    	            name:'降水量',
    	            type:'bar',
    	            itemStyle: {
    	                normal: {
    	                    label : {
    	                        show: true, position: 'top'
    	                    }
    	                }
    	            },
    	        }]
    	};

    module.exports = function(data, widget) {        
        var myChart = echarts.init(document.getElementById('appointRoom'));
        var days = [];
        var roomCount = [];
        for(var i=0;i<data.length;i++){
        	days.push(data[i].day);
        	roomCount.push(data[i].roomCount);
        }
        option.xAxis[0].data=days;
        option.series[0].data=roomCount;
        myChart.setOption(option);
        return myChart;
    };
});
